package controller;

import java.util.Date;

import view.MainWindow;
import model.ExerciseList;
import model.GymList;
import model.MySQL;
import model.Purpose;
import model.User;
import model.UserList;
import model.WorkoutPlan;

public class Controller {

	private MySQL SQL = null;
	private MainWindow frame = null;
	private User currentUser = null;
	private WorkoutPlan currentPlan = null;
	private UserList userList = null;
	private GymList gymList = null;
	private ExerciseList exerciseList = null;

	public Controller() {
		// this.SQL = new MySQL("localhost", "root", "tpm2013",
		// "trainingsplanmanagement");
		this.setUserList(new UserList(this));
		this.setGymList(new GymList(this));
		this.exerciseList = new ExerciseList(this);
	}

	public UserList getUserList() {
		return userList;
	}

	public void setUserList(UserList userList) {
		this.userList = userList;
	}

	public GymList getGymList() {
		return gymList;
	}

	public void setGymList(GymList gymList) {
		this.gymList = gymList;
	}

	public ExerciseList getExerciseList() {
		return exerciseList;
	}

	public void setExerciseList(ExerciseList exerciseList) {
		this.exerciseList = exerciseList;
	}

	public MySQL getSQL() {
		return SQL;
	}

	public void setSQL(MySQL SQL) {
		this.SQL = SQL;
	}

	public MainWindow getFrame() {
		return frame;
	}

	public void setFrame(MainWindow frame) {
		this.frame = frame;
	}

	public User getCurrentUser() {
		return currentUser;
	}

	public void setCurrentUser(User currentUser) {
		this.currentUser = currentUser;
	}

	public WorkoutPlan getCurrentPlan() {
		return currentPlan;
	}

	public void setCurrentPlan(WorkoutPlan currentPlan) {
		this.currentPlan = currentPlan;
	}

	public void setNewCurrentPlan(int duration, int sets, Purpose purpose) {
		this.currentPlan = new WorkoutPlan(currentUser, duration, sets,
				purpose, new Date());
	}

}
